import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { TaskComponent } from './task.component';
import { AuthGuard } from 'src/app/auth/auth.guard';
import { DetailComponent } from './detail/detail.component';

// prefix / full  loadChildren: () => import('./page/publish/publish.module').then(mod => mod.PublishModule)
const routes: Routes = [
    {
        path: '',
        canActivate: [AuthGuard],
        children: [
            {path: '', redirectTo: '/task', pathMatch: 'full'},
            {path: 'task', component: TaskComponent},
            {path: 'detail', component: DetailComponent},
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class TaskRoutingModule { }
